/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package validator;

/**
 *
 * @author Chris
 */
public class validPW extends validator {
    public validPW() { err = ERRORS.VALID; }
    
    public boolean isValid(String password) { 
        if(password == null) {
            err = ERRORS.INVALID_PW;
            return false;
        }
        if(password.matches("([A-Z]|[a-z]|_|[0-9]){4,30}")) {
            err = ERRORS.VALID;
            return true;
        }
        err = ERRORS.INVALID_PW;
        return false;
    }
}